package me.cloudcat.hystrix.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.ws.rs.Produces;

/**
 * @Author: jiafeim12345@163.com
 * @Date: 2018/3/25/025 17:21
 */
@RestController
@Produces("application/json")
public class TestController {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping(value = "/testOne", method = RequestMethod.GET)
    public String testOne(Model model) {
        return restTemplate.getForObject("http://eureka-client/hi", String.class);
    }

}
